package com.lixixi.tingshu.album.api;

import com.lixixi.tingshu.common.result.Result;
import com.lixixi.tingshu.model.album.AlbumInfo;
import com.lixixi.tingshu.model.album.BaseCategory3;
import com.lixixi.tingshu.model.album.BaseCategoryView;
import com.lixixi.tingshu.model.album.TrackInfo;
import com.lixixi.tingshu.vo.album.AlbumStatVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient("album-service")
public interface AlbumApiFeignClient {

	//@RequestMapping: /api/album/albumInfo
//	#############  albumInfo  ####################
	@GetMapping("/api/album/albumInfo/getAlbumInfo/search/{albumId}")
	Result<AlbumInfo> getAlbumInfoById(@PathVariable(value = "albumId", required = true) Long albumId);

	@GetMapping("/api/album/albumInfo/getAlbumStatBatch/search")
	Result<Map<Long, List<AlbumStatVo>>> getAlbumStatByIdBatch(@RequestBody List<Long> albumIdList);

	@GetMapping("/api/album/albumInfo/getAlbumStat/search/{albumId}")
	Result<AlbumStatVo> getAlbumStatById(@PathVariable(value = "albumId") Long albumId);

	@GetMapping("/api/album/albumInfo/getAlbumIdListByUserId/{userId}")
	Result<List<AlbumInfo>> getAlbumIdListByUserId(@PathVariable("userId") Long userId);

	@GetMapping("/api/album/albumInfo/getUserAlbumInfoByBatch")
	Result<List<AlbumInfo>> getUserAlbumInfoByBatch(@RequestBody Long userId);

	//@RequestMapping: /api/album/trackInfo
//	#############  trackInfo  ####################
	@GetMapping("/api/album/trackInfo/getOrderTrackInfoList")
	Result<List<TrackInfo>> getOrderTrackInfoList(@RequestParam("itemId") Long itemId, @RequestParam("trackCount") Integer trackCount);

	@GetMapping("/api/album/trackInfo/getAlbumIdByTrackId/{trackId}")
	Result<Long> getAlbumIdByTrackId(@PathVariable("trackId") Long trackId);

	//@RequestMapping: /api/album/category
//	#############  category  ####################
	@GetMapping("/api/album/category/findBaseCategory3/{category1Id}")
	Result<List<BaseCategory3>> findBaseCategory3(@PathVariable("category1Id")Long categoryId1);

	@GetMapping("/api/album/category/findTopBaseCategory3/{category1Id}")
	Result<List<BaseCategory3>> findTopBaseCategory3(@PathVariable("category1Id")Long categoryId1);

	@GetMapping("/api/album/category/findCategoryByCategory3Id/{category3Id}")
	Result<BaseCategoryView> findCategoryByCategory3Id(@PathVariable("category3Id") Long category3Id);

	@GetMapping("/api/album/category/findCategoryByCategory3IdBatch")
	Result<Map<Long, List<BaseCategoryView>>> findCategoryByCategory3IdBatch(@RequestBody List<Long> category3IdList);

	@GetMapping("/api/album/category/getCategory1IdAll")
	Result<List<Long>> getCategory1IdAll();
}
